package com.jiawa.wiki.controller;

import com.jiawa.wiki.domain.Test;
import com.jiawa.wiki.service.TestService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class TestController {

    public String testhello;

    @GetMapping("/hello1")
    public String hello(){
        return "hello world";
    }

    @PostMapping("/hello/post")
    public String post(String name){
        return"helloword"+name;
    }

    //依赖注入
    @Resource
    public TestService testService;

    @GetMapping("/test/list")
    public List<Test> list(){
        return testService.list();
    }
}
